<template>
  <button v-longpress="fn1">长按</button>

  <button v-copy="'张三'">复制 张三</button>
  <button v-copy="'里斯'">复制 里斯</button>
  <hr />
  <div class="demo" v-waterMarker></div>

  <div class="demo" v-waterMarker="{ text: '张三', color: 'yellow' }"></div>
</template>

<script>
// 引入 waterMaker 指令的配置对象
// import waterMarker from './directives/modules/waterMarker'
// import longpress from './directives/modules/longpress'
// import copy from './directives/modules/copy'

export default {
  // directives: {
  //   waterMarker,
  //   longpress,
  //   copy
  // },

  methods: {
    fn1() {
      console.log('fn1')
    },

    fn2() {
      navigator.clipboard.writeText('张三')
    }
  }
}
</script>

<style>
.demo {
  font-family: sans-serif;
  border: 1px solid #eee;
  border-radius: 2px;
  padding: 20px 30px;
  margin-top: 1em;
  margin-bottom: 40px;

  min-height: 300px;
  user-select: none;
  overflow-x: auto;
}
</style>
